package com.xiaoshuidi.cloud.module.contract.framework.datapermission.config;

import com.xiaoshuidi.cloud.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer;
import com.xiaoshuidi.cloud.module.contract.dal.dataobject.bill.RentOrderDO;
import com.xiaoshuidi.cloud.module.contract.dal.dataobject.contract.ContractApplyDO;
import com.xiaoshuidi.cloud.module.contract.dal.dataobject.contract.ContractHouseOwnerDO;
import com.xiaoshuidi.cloud.module.contract.dal.dataobject.contract.ContractRoomDO;
import com.xiaoshuidi.cloud.module.contract.dal.dataobject.contract.SettlementDO;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
public class DataPermissionConfiguration {
    @Bean
    public DeptDataPermissionRuleCustomizer dataPermissionRuleCustomizer() {
        return rule -> {
            rule.addDeptColumn(RentOrderDO.class);
            rule.addDeptColumn(ContractRoomDO.class);
            rule.addDeptColumn(ContractHouseOwnerDO.class);
            rule.addDeptColumn(ContractApplyDO.class,"apartment_id");
            rule.addDeptColumn(SettlementDO.class,"apartment_id");
        };
    }
}
